package com.laijiale.entity;

import com.mybatisflex.annotation.*;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;


import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 开发评论表 实体类。
 *
 * @author laijiale
 * @since 2024-12-22
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(value = "comment", schema = "ml_cms")
public class Comment implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @Id(keyType = KeyType.Auto)
    private Long id;

    /**
     * 集次ID
     */
    private Long fkEpisodeId;

    /**
     * 举报人ID
     */
    private Long fkUserId;

    /**
     * 评论人昵称（冗余）
     */
    private String nickname;

    /**
     * 父评论主键
     */
    private Long pid;

    /**
     * 评论内容
     */
    private String content;

    /**
     * 数据版本
     */
    @Column(version = true)
    private Long version;

    /**
     * 逻辑删除
     */
    @Column(isLogicDelete = true)
    private Integer deleted;

    /**
     * 创建时间
     */
    private LocalDateTime created;

    /**
     * 修改时间
     */
    private LocalDateTime updated;


    /** 评论[N] : 视频集[1] */
    @RelationManyToOne(selfField = "fkEpisodeId", targetField = "id")
    private Episode episode;

}
